package com.chat.api.utils.util;

import java.util.Calendar;

/**
 * @author chengw
 */
public class TaskTimeUtil {
    public static final String ANNUAL = "annual";

    public static final String CURRENT_MONTH = "current_month";

    public static final String LAST_MONTH = "last_month";

    public static final String NEXT_MONTH = "next_month";

    public static final String INVEST = "invest";

    public static final String FINANCE = "finance";

    public static final String CONSTRUCT_COST = "construct_cost";

    private static final String CRON_DATE_FORMATE = "ss mm HH dd MM ? yyyy";

    public static String Date2CronPerYear(Calendar calendar){

        int MM = calendar.get(Calendar.MONTH) + 1;
        int dd = calendar.get(Calendar.DATE);

        String cron = "0 0 0 " + dd + " " + MM + " ? ";

        return cron;
    }

    public static String Date2CronPerMonth(Calendar calendar){

        int dd = calendar.get(Calendar.DATE);

        String cron = "0 0 0 " + dd + " * ? ";

        return cron;
    }




}
